<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="generator" content="Docusaurus v2.0.0-alpha.54">
<link rel="preconnect" href="https://www.google-analytics.com">
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create","UA-128126650-1","auto"),ga("send","pageview")</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
<link rel="preconnect" href="https://www.google-analytics.com">
<link rel="preconnect" href="https://www.googletagmanager.com">
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-128126650-1"></script>
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-128126650-1",{})</script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,700;1,400&family=Roboto:wght@900&display=swap">

<title data-react-helmet="true">src() | gulp.js</title>

<meta data-react-helmet="true" name="twitter:card" content="summary_large_image"><meta data-react-helmet="true" property="og:title" content="src() | gulp.js"><meta data-react-helmet="true" name="description" content="# src()"><meta data-react-helmet="true" property="og:description" content="# src()"><meta data-react-helmet="true" property="og:url" content="https://gulpjs.com//docs/en/api/src">

<link data-react-helmet="true" rel="shortcut icon" href="/img/favicon.png">


<link rel="stylesheet" href="/styles.8121b95c.css">


<link rel="preload" href="/styles.10c0193b.js" as="script">

<link rel="preload" href="/runtime~main.ae01ffbb.js" as="script">

<link rel="preload" href="/main.3e1928f1.js" as="script">

<link rel="preload" href="/1.fe6bacd8.js" as="script">

<link rel="preload" href="/2.77a8f44b.js" as="script">

<link rel="preload" href="/1be78505.2d41add8.js" as="script">

<link rel="preload" href="/37.ee8d4ee9.js" as="script">

<link rel="preload" href="/10002e1b.63b80d46.js" as="script">

<link rel="preload" href="/17896441.f1e2ba83.js" as="script">

<link rel="preload" href="/f7978408.eff23140.js" as="script">

</head>
<body>

<div id="__docusaurus">
<nav class="navbar navbar--light navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><a class="navbar__brand" target="_self" href="/"><img class="navbar__logo" src="/img/gulp.svg" alt="gulp"></a><a activeclassname="navbar__link--active" class="navbar__item navbar__link noWrap_BxdH" href="/docs/en/getting-started/quick-start">Get Started</a><a activeclassname="navbar__link--active" class="navbar__item navbar__link noWrap_BxdH" href="/docs/en/api/concepts">API</a><a activeclassname="navbar__link--active" class="navbar__item navbar__link noWrap_BxdH" href="/plugins">Plugins</a><a target="_blank" rel="noopener noreferrer" href="https://github.com/sponsors/gulpjs" class="navbar__item navbar__link noWrap_BxdH">Donate</a><a activeclassname="navbar__link--active" class="navbar__item navbar__link emphasis_1Gl9 noWrap_BxdH" href="/docs/en/support/for-enterprise">Enterprise</a></div><div class="navbar__items navbar__items--right"><a target="_blank" rel="noopener noreferrer" href="https://twitter.com/gulpjs" class="navbar__item navbar__link navbar__link--icon noWrap_BxdH"><img class="navbarIcon_2_MD" src="/img/twitter.svg" alt="Gulp on Twitter"></a><a target="_blank" rel="noopener noreferrer" href="https://medium.com/gulpjs" class="navbar__item navbar__link navbar__link--icon noWrap_BxdH"><img class="navbarIcon_2_MD" src="/img/medium.svg" alt="The gulp blog"></a><div class="navbar__search"><span aria-label="expand searchbar" role="button" class="search-icon search-icon-hidden" tabindex="0"></span><input type="search" id="search_input_react" placeholder="Search" aria-label="Search" class="navbar__search-input search-bar-expanded"></div></div></div></nav><div class="main-wrapper"><div class="docPage_1kjD"><div class="docSidebarContainer_1cYp"><div class="sidebar_1kLs"><div class="menu menu--responsive menu_w2sC"><button aria-label="Open Menu" aria-haspopup="true" class="button button--secondary button--sm menu__button" type="button"><svg aria-label="Menu" class="sidebarMenuIcon_2vk4" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 32 32" role="img" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><ul class="menu__list"><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">Getting Started</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/en/getting-started/quick-start">Quick Start</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/en/getting-started/javascript-and-gulpfiles">JavaScript and Gulpfiles</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/en/getting-started/creating-tasks">Creating Tasks</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/en/getting-started/async-completion">Async Completion</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/en/getting-started/working-with-files">Working with Files</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/en/getting-started/explaining-globs">Explaining Globs</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/en/getting-started/using-plugins">Using Plugins</a></li><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/en/getting-started/watching-files">Watching Files</a></li></ul></li><li class="menu__list-item"><a class="menu__link menu__link--sublist menu__link--active" href="#!">API</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/concepts">Concepts</a></li><li class="menu__list-item"><a aria-current="page" class="menu__link menu__link--active" tabindex="0" href="/docs/en/api/src">src()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/dest">dest()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/symlink">symlink()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/lastrun">lastRun()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/series">series()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/parallel">parallel()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/watch">watch()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/task">task()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/registry">registry()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/tree">tree()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/vinyl">Vinyl</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/vinyl-isvinyl">Vinyl.isVinyl()</a></li><li class="menu__list-item"><a class="menu__link" tabindex="0" href="/docs/en/api/vinyl-iscustomprop">Vinyl.isCustomProp()</a></li></ul></li><li class="menu__list-item menu__list-item--collapsed"><a class="menu__link menu__link--sublist" href="#!">Support</a><ul class="menu__list"><li class="menu__list-item"><a class="menu__link" tabindex="-1" href="/docs/en/support/for-enterprise">For Enterprise</a></li></ul></li></ul></div></div></div><main class="docMainContainer_FFX1"><div class="container padding-vert--lg docItemWrapper_1cc7"><div class="row"><div class="col docItemCol_2GOA"><div class="docItemContainer_2cwg"><article><div class="markdown"><h1><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="src"></a><a aria-hidden="true" tabindex="-1" class="hash-link" href="#src" title="Direct link to heading">#</a>src()</h1><p>Creates a stream for reading <a href="/docs/en/api/concepts#vinyl">Vinyl</a> objects from the file system.</p><p><strong>Note:</strong> BOMs (byte order marks) have no purpose in UTF-8 and will be removed from UTF-8 files read by <code>src()</code>, unless disabled using the <code>removeBOM</code> option.</p><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="usage"></a><a aria-hidden="true" tabindex="-1" class="hash-link" href="#usage" title="Direct link to heading">#</a>Usage</h2><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-javascript codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#9CDCFE;background-color:#1E1E1E"><div class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> src</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> dest </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">require</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;gulp&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">copy</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword" style="color:rgb(86, 156, 214)">return</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">src</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;input/*.js&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">pipe</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token function" style="color:rgb(220, 220, 170)">dest</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;output/&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain">exports</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">copy</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> copy</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span></div></div></div></div></div><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="signature"></a><a aria-hidden="true" tabindex="-1" class="hash-link" href="#signature" title="Direct link to heading">#</a>Signature</h2><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-js codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#9CDCFE;background-color:#1E1E1E"><div class="token-line" style="color:#9CDCFE"><span class="token function" style="color:rgb(220, 220, 170)">src</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">globs</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span></div></div></div></div></div><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="parameters"></a><a aria-hidden="true" tabindex="-1" class="hash-link" href="#parameters" title="Direct link to heading">#</a>Parameters</h3><table><thead><tr><th align="center">parameter</th><th align="center">type</th><th>note</th></tr></thead><tbody><tr><td align="center">globs</td><td align="center">string<br>array</td><td><a href="/docs/en/api/concepts#globs">Globs</a> to watch on the file system.</td></tr><tr><td align="center">options</td><td align="center">object</td><td>Detailed in <a href="#options">Options</a> below.</td></tr></tbody></table><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="returns"></a><a aria-hidden="true" tabindex="-1" class="hash-link" href="#returns" title="Direct link to heading">#</a>Returns</h3><p>A stream that can be used at the beginning or in the middle of a pipeline to add files based on the given globs.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="errors"></a><a aria-hidden="true" tabindex="-1" class="hash-link" href="#errors" title="Direct link to heading">#</a>Errors</h3><p>When the <code>globs</code> argument can only match one file (such as <code>foo/bar.js</code>) and no match is found, throws an error with the message, &quot;File not found with singular glob&quot;. To suppress this error, set the <code>allowEmpty</code> option to <code>true</code>.</p><p>When an invalid glob is given in <code>globs</code>, throws an error with the message, &quot;Invalid glob argument&quot;.</p><h3><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="options"></a><a aria-hidden="true" tabindex="-1" class="hash-link" href="#options" title="Direct link to heading">#</a>Options</h3><p><strong>For options that accept a function, the passed function will be called with each Vinyl object and must return a value of another listed type.</strong></p><table><thead><tr><th align="center">name</th><th align="center">type</th><th>default</th><th>note</th></tr></thead><tbody><tr><td align="center">buffer</td><td align="center">boolean<br>function</td><td>true</td><td>When true, file contents are buffered into memory. If false, the Vinyl object&#x27;s <code>contents</code> property will be a paused stream. It may not be possible to buffer the contents of large files.<br><strong>Note:</strong> Plugins may not implement support for streaming contents.</td></tr><tr><td align="center">read</td><td align="center">boolean<br>function</td><td>true</td><td>If false, files will be not be read and their Vinyl objects won&#x27;t be writable to disk via <code>.dest()</code>.</td></tr><tr><td align="center">since</td><td align="center">date<br>timestamp<br>function</td><td></td><td>When set, only creates Vinyl objects for files modified since the specified time.</td></tr><tr><td align="center">removeBOM</td><td align="center">boolean<br>function</td><td>true</td><td>When true, removes the BOM from UTF-8 encoded files. If false, ignores a BOM.</td></tr><tr><td align="center">sourcemaps</td><td align="center">boolean<br>function</td><td>false</td><td>If true, enables <a href="#sourcemaps">sourcemaps</a> support on Vinyl objects created. Loads inline sourcemaps and resolves external sourcemap links.</td></tr><tr><td align="center">resolveSymlinks</td><td align="center">boolean<br>function</td><td>true</td><td>When true, recursively resolves symbolic links to their targets. If false, preserves the symbolic links and sets the Vinyl object&#x27;s <code>symlink</code> property to the original file&#x27;s path.</td></tr><tr><td align="center">cwd</td><td align="center">string</td><td><code>process.cwd()</code></td><td>The directory that will be combined with any relative path to form an absolute path. Is ignored for absolute paths. Use to avoid combining <code>globs</code> with <code>path.join()</code>.<br><em>This option is passed directly to <a href="https://github.com/gulpjs/glob-stream">glob-stream</a>.</em></td></tr><tr><td align="center">base</td><td align="center">string</td><td></td><td>Explicitly set the <code>base</code> property on created Vinyl objects. Detailed in <a href="/docs/en/api/concepts#glob-base">API Concepts</a>.<br><em>This option is passed directly to <a href="https://github.com/gulpjs/glob-stream">glob-stream</a>.</em></td></tr><tr><td align="center">cwdbase</td><td align="center">boolean</td><td>false</td><td>If true, <code>cwd</code> and <code>base</code> options should be aligned.<br><em>This option is passed directly to <a href="https://github.com/gulpjs/glob-stream">glob-stream</a>.</em></td></tr><tr><td align="center">root</td><td align="center">string</td><td></td><td>The root path that <code>globs</code> are resolved against.<br><em>This option is passed directly to <a href="https://github.com/gulpjs/glob-stream">glob-stream</a>.</em></td></tr><tr><td align="center">allowEmpty</td><td align="center">boolean</td><td>false</td><td>When false, <code>globs</code> which can only match one file (such as <code>foo/bar.js</code>) causes an error to be thrown if they don&#x27;t find a match. If true, suppresses glob failures.<br><em>This option is passed directly to <a href="https://github.com/gulpjs/glob-stream">glob-stream</a>.</em></td></tr><tr><td align="center">uniqueBy</td><td align="center">string<br>function</td><td><code>&#x27;path&#x27;</code></td><td>Remove duplicates from the stream by comparing the string property name or the result of the function.<br><strong>Note:</strong> When using a function, the function receives the streamed data (objects containing <code>cwd</code>, <code>base</code>, <code>path</code> properties).</td></tr><tr><td align="center">dot</td><td align="center">boolean</td><td>false</td><td>If true, compare globs against dot files, like <code>.gitignore</code>.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">silent</td><td align="center">boolean</td><td>true</td><td>When true, suppresses warnings from printing on <code>stderr</code>.<br><strong>Note:</strong> This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a> but defaulted to <code>true</code> instead of <code>false</code>.</td></tr><tr><td align="center">mark</td><td align="center">boolean</td><td>false</td><td>If true, a <code>/</code> character will be appended to directory matches. Generally not needed because paths are normalized within the pipeline.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">nosort</td><td align="center">boolean</td><td>false</td><td>If true, disables sorting the glob results.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">stat</td><td align="center">boolean</td><td>false</td><td>If true, <code>fs.stat()</code> is called on all results. This adds extra overhead and generally should not be used.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">strict</td><td align="center">boolean</td><td>false</td><td>If true, an error will be thrown if an unexpected problem is encountered while attempting to read a directory.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">nounique</td><td align="center">boolean</td><td>false</td><td>When false, prevents duplicate files in the result set.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">debug</td><td align="center">boolean</td><td>false</td><td>If true, debugging information will be logged to the command line.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">nobrace</td><td align="center">boolean</td><td>false</td><td>If true, avoids expanding brace sets - e.g. <code>{a,b}</code> or <code>{1..3}</code>.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">noglobstar</td><td align="center">boolean</td><td>false</td><td>If true, treats double-star glob character as single-star glob character.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">noext</td><td align="center">boolean</td><td>false</td><td>If true, avoids matching <a href="/docs/en/documentation-missing">extglob</a> patterns - e.g. <code>+(ab)</code>.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">nocase</td><td align="center">boolean</td><td>false</td><td>If true, performs a case-insensitive match.<br><strong>Note:</strong> On case-insensitive file systems, non-magic patterns will match by default.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">matchBase</td><td align="center">boolean</td><td>false</td><td>If true and globs don&#x27;t contain any <code>/</code> characters, traverses all directories and matches that glob - e.g. <code>*.js</code> would be treated as equivalent to <code>**/*.js</code>.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">nodir</td><td align="center">boolean</td><td>false</td><td>If true, only matches files, not directories.<br><strong>Note:</strong> To match only directories, end your glob with a <code>/</code>.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">ignore</td><td align="center">string<br>array</td><td></td><td>Globs to exclude from matches. This option is combined with negated <code>globs</code>.<br><strong>Note:</strong> These globs are always matched against dot files, regardless of any other settings.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">follow</td><td align="center">boolean</td><td>false</td><td>If true, symlinked directories will be traversed when expanding <code>**</code> globs.<br><strong>Note:</strong> This can cause problems with cyclical links.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">realpath</td><td align="center">boolean</td><td>false</td><td>If true, <code>fs.realpath()</code> is called on all results. This may result in dangling links.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">cache</td><td align="center">object</td><td></td><td>A previously generated cache object - avoids some file system calls.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">statCache</td><td align="center">object</td><td></td><td>A previously generated cache of <code>fs.Stat</code> results - avoids some file system calls.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">symlinks</td><td align="center">object</td><td></td><td>A previously generated cache of symbolic links - avoids some file system calls.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr><tr><td align="center">nocomment</td><td align="center">boolean</td><td>false</td><td>When false, treat a <code>#</code> character at the start of a glob as a comment.<br><em>This option is passed directly to <a href="https://github.com/isaacs/node-glob">node-glob</a>.</em></td></tr></tbody></table><h2><a aria-hidden="true" tabindex="-1" class="anchor enhancedAnchor_ZqCz" id="sourcemaps"></a><a aria-hidden="true" tabindex="-1" class="hash-link" href="#sourcemaps" title="Direct link to heading">#</a>Sourcemaps</h2><p>Sourcemap support is built directly into <code>src()</code> and <code>dest()</code>, but is disabled by default. Enable it to produce inline or external sourcemaps.</p><p>Inline sourcemaps:</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-js codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#9CDCFE;background-color:#1E1E1E"><div class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> src</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> dest </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">require</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;gulp&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> uglify </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">require</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;gulp-uglify&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token function" style="color:rgb(220, 220, 170)">src</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;input/**/*.js&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> sourcemaps</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">pipe</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token function" style="color:rgb(220, 220, 170)">uglify</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">pipe</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token function" style="color:rgb(220, 220, 170)">dest</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;output/&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> sourcemaps</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span></div></div></div></div></div><p>External sourcemaps:</p><div class="mdxCodeBlock_iHAB"><div class="codeBlockContent_32p_"><button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button><div tabindex="0" class="prism-code language-js codeBlock_19pQ"><div class="codeBlockLines_2n9r" style="color:#9CDCFE;background-color:#1E1E1E"><div class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> src</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> dest </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">require</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;gulp&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> uglify </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">require</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;gulp-uglify&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block">
</span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token function" style="color:rgb(220, 220, 170)">src</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;input/**/*.js&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> sourcemaps</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">pipe</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token function" style="color:rgb(220, 220, 170)">uglify</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span></div><div class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">pipe</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token function" style="color:rgb(220, 220, 170)">dest</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;output/&#x27;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> sourcemaps</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">&#x27;.&#x27;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span></div></div></div></div></div></div></article><div class="margin-vert--lg"><nav class="pagination-nav"><div class="pagination-nav__item"><a class="pagination-nav__link" href="/docs/en/api/concepts"><div class="pagination-nav__link--sublabel">Previous</div><div class="pagination-nav__link--label">« API Concepts</div></a></div><div class="pagination-nav__item pagination-nav__item--next"><a class="pagination-nav__link" href="/docs/en/api/dest"><div class="pagination-nav__link--sublabel">Next</div><div class="pagination-nav__link--label">dest() »</div></a></div></nav></div></div></div><div class="col col--3"><div class="tableOfContents_TbNY"><ul class="contents contents__left-border"><li><a href="#usage" class="contents__link">Usage</a></li><li><a href="#signature" class="contents__link">Signature</a><ul><li><a href="#parameters" class="contents__link">Parameters</a></li><li><a href="#returns" class="contents__link">Returns</a></li><li><a href="#errors" class="contents__link">Errors</a></li><li><a href="#options" class="contents__link">Options</a></li></ul></li><li><a href="#sourcemaps" class="contents__link">Sourcemaps</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container"><div class="row footer__links"><div class="col footer__col"><ul class="footer__items"><li class="footer__item"><img src="/img/gulp-white-logo.svg" alt="gulp" href="/"></li></ul></div><div class="col footer__col"><h4 class="footer__title">Docs</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" href="/docs/en/getting-started/quick-start">Getting Started</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/en/api/concepts">API</a></li></ul></div><div class="col footer__col"><h4 class="footer__title">Community</h4><ul class="footer__items"><li class="footer__item"><a class="footer__link-item" target="_blank" rel="noopener noreferrer" href="https://github.com/gulpjs/gulp">GitHub</a></li><li class="footer__item"><a class="footer__link-item" target="_blank" rel="noopener noreferrer" href="https://stackoverflow.com/questions/tagged/gulp">Stack Overflow</a></li><li class="footer__item"><a class="footer__link-item" target="_blank" rel="noopener noreferrer" href="https://twitter.com/gulpjs">Twitter</a></li></ul></div></div><div class="text--center"><div></div></div></div></footer>
</div>

<script src="/styles.10c0193b.js"></script>

<script src="/runtime~main.ae01ffbb.js"></script>

<script src="/main.3e1928f1.js"></script>

<script src="/1.fe6bacd8.js"></script>

<script src="/2.77a8f44b.js"></script>

<script src="/1be78505.2d41add8.js"></script>

<script src="/37.ee8d4ee9.js"></script>

<script src="/10002e1b.63b80d46.js"></script>

<script src="/17896441.f1e2ba83.js"></script>

<script src="/f7978408.eff23140.js"></script>


</body>
</html>